#ifndef _RDB_ATTRIBUTE_H_
#define _RDB_ATTRIBUTE_H_

#include <buildspec.h>
#include <Client/ClientUtils/Network/TableAttributeVal.h>

namespace GST {
namespace ClientUtils {

	class AbstractRDBAttributeDesc
		: public TableAttributeDesc
	{
		bool is_primaryKey;
	public:
		void set_is_primaryKey(bool is_primaryKey);
		GST_API_EXPORT AbstractRDBAttributeDesc(const TableAttributeDesc & desc, bool is_primaryKey);
		GST_API_EXPORT AbstractRDBAttributeDesc();
	
		virtual std::string GST_API_EXPORT ToDDL() const;
		virtual std::string GST_API_EXPORT Type2DDL() const = 0;
	};
	typedef boost::shared_ptr<AbstractRDBAttributeDesc> AbstractRDBAttributeDescPtr;	
	GST_API_EXPORT std::ostream& operator<<(std::ostream& stream, const AbstractRDBAttributeDesc& RDBattr);
	GST_API_EXPORT std::ostream& operator<<(std::ostream& stream, const AbstractRDBAttributeDescPtr& RDBattr);

	class RDBAttributeDescList
		: public TableAttributeDescList
	{
	public:
		virtual void GST_API_EXPORT ToDDL(std::ostream& stream) const;
	};
	typedef boost::shared_ptr<RDBAttributeDescList> RDBAttributeDescListPtr;
	GST_API_EXPORT std::ostream& operator<<(std::ostream& stream, const RDBAttributeDescList& list);
	GST_API_EXPORT std::ostream& operator<<(std::ostream& stream, const RDBAttributeDescListPtr& list);

	class GST_API_EXPORT AbstractRDBAttributeVal
		: public TableAttributeVal
	{
	public:
		AbstractRDBAttributeVal(TableAttributeDescPtr desc, const boost::any& value)
			: TableAttributeVal(desc, value)
		{}
		AbstractRDBAttributeVal()
		{}
	
		virtual std::string getValueAsDML() const = 0;
	};
	typedef boost::shared_ptr<AbstractRDBAttributeVal> AbstractRDBAttributeValPtr;

}// namespace ClientUtils
}// namespace GST


#endif  //_RDB_ATTRIBUTE_H_
